/*
 * @Author: Nice-2-CU 81088875+Nice-2-CU@users.noreply.github.com
 * @Date: 2023-07-10 14:16:48
 * @LastEditors: Nice-2-CU 81088875+Nice-2-CU@users.noreply.github.com
 * @LastEditTime: 2023-07-19 16:10:34
 * @FilePath: \lost-found-management\src\api\auth\user.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
import Cookies from 'js-cookie'

export function loginByPassword(data) {
  return request({
    url: '/auth/user/phonePasswordLogin',
    method: 'post',
    data
  })
}

export function loginByShortMsg(data) {
  return request({
    url: '/auth/user/phoneCaptchaLogin',
    method: 'post',
    data
  })
}

export function getShortMsg(data) {
  return request({
    url: '/auth/user/sendSmsCaptcha',
    method: 'get',
    params: data
  })
}

export function logout(data) {
  return request({
    url: '/auth/user/logout',
    method: 'get',
    params: data
  })
}

export function getUserList(data) {
  return request({
    url: '/auth/user/query/page',
    method: 'post',
    data
  })
}

export function getDetailInfoById(data) {
  return request({
    url: '/auth/user/query/detailInfoById/' + data.id,
    method: 'get',
    params: data
  })
}

export function getBaseInfoById(data) {
  return request({
    url: '/auth/user/query/baseInfoById/' + data.id,
    method: 'get',
    params: data
  })
}

export function addUser(data) {
  return request({
    url: '/auth/user/insertUserWithAdmin',
    method: 'post',
    data
  })
}

export function editUserWithAdmin(data) {
  return request({
    url: '/auth/user/updateUserWithAdmin',
    method: 'put',
    data
  })
}

export function userDisable(data) {
  return request({
    url: '/auth/user/disable',
    method: 'put',
    data
  })
}

export function useruntieDisable(data) {
  return request({
    url: '/auth/user/untieDisable',
    method: 'put',
    data
  })
}
